package com.chinasofti;

import java.util.Scanner;

public class Demo06 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String id = "admin";
        String pwd = "123456";
        for(int i = 1;i<4;i++){
            System.out.print("请输入账号：");
            String s = sc.next();
            System.out.print("请输入密码：");
            String   s1 = sc.next();
            if(s.equals(id)&&s1.equals(pwd)){
                System.out.println("登录成功！");
                break;
            }else if(i==3){
                System.out.println("今日登录已达上限，请稍后再试");
                break;
            }
            else{
                System.out.println("您的账号或密码有误");
                System.out.println("你还可以尝试登录"+(3-i)+"次");
            }
        }
    }
}
